package jp.gr.java_conf.yuzu_project;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;

/**
 * チームロゴ表示.
 * 
 * @author ゆずプロジェクト
 *
 */
public class StartActivity extends Activity implements AnimationListener{
	
	private Animation fadeIn;
	private RelativeLayout mainLayout;
	private Intent intent;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_start);
        
        mainLayout = (RelativeLayout) findViewById(R.id.start_display);
        
        fadeIn = AnimationUtils.loadAnimation(getBaseContext(), R.anim.title_anim);
        fadeIn.setAnimationListener(this);
        mainLayout.setAnimation(fadeIn);
    }

	public void onAnimationEnd(Animation animation) {
		intent = new Intent(this, TitleActivity.class);
		startActivity(intent);
		finish();
	}

	public void onAnimationRepeat(Animation animation) {
		
	}

	public void onAnimationStart(Animation animation) {
		
	}

	@Override
	protected void onPause() {
		fadeIn = null;
		mainLayout = null;
		intent = null;
		super.onPause();
	}

    
}
